﻿package ui;

import javax.swing.JLabel;
import components.MyButton;
import components.MyFrame;
import components.MyPanel;



public class MainPanel extends MyPanel {

	private MyButton logoutButton;
	private MyButton returnbackButton;
	
	private JLabel selectionLabel;
	private MyButton managecustomerButton;
	private MyButton manageorderButton;
	private MyButton managebookButton;
	private MyButton managetypeButton;

	protected void initComponent() {
		logoutButton = new MyButton("注销");
		returnbackButton = new MyButton("返回");
		logoutButton.setBounds(MyFrame.WIDTH-80,0, 80, 20);
		returnbackButton.setBounds(MyFrame.WIDTH-160,0, 80, 20);
		this.add(logoutButton);
		this.add(returnbackButton);
		
		this.setBounds(400, 200, 300, 300);
		selectionLabel = new JLabel("请选择一项操作：");
		managecustomerButton = new MyButton("管理顾客信息");
		manageorderButton = new MyButton("管理订单信息");
		managebookButton = new MyButton("管理图书信息");
		managetypeButton = new MyButton("管理图书类别");
		selectionLabel.setBounds(10, 40, 120, 20);
		managecustomerButton.setBounds(30, 80, 120,20);
		manageorderButton.setBounds(30, 120, 120, 20);
		managebookButton.setBounds(30, 160, 120, 20);
		managetypeButton.setBounds(30, 200, 120, 20);
		this.add(selectionLabel);
		this.add(managecustomerButton);
		this.add(manageorderButton);
		this.add(managebookButton);
		this.add(managetypeButton);
		
		logoutButton.setButtonAction("logout");
		returnbackButton.setButtonAction("logout");
		managecustomerButton.setButtonAction("toCustomerQuery");
		manageorderButton.setButtonAction("toOrderQuery");
		managebookButton.setButtonAction("toBookQuery");
		managetypeButton.setButtonAction("toModifyType");
	}

	@Override
	protected void updateVO() {
		
	}

}
